/*
    This is a set of libraries to assist in OpenGl and Other Applications
    Copyright (C) 2008  The Modular Engine Team

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HUDMODULE_H
#define HUDMODULE_H
#include <iostream>
#include <vector>
#include "EngineCore.h"
#include "OpenglModule.h"
#include "HUDElement.h"
#include "math.h"


// HUDModule will be basis for windows, buttons, etc.

namespace ModularEngine
{
	class CLASSDECL HUDModule: BASE(HUDModule)
	{
	protected:
		// Pointer to OpenglModule singleton
		// allows usage of OpenglModule throughout the class
		// easily.
		ModularEngine::OpenglModule *gl; 
	
		// Color scheme for the HUD
		Vector3d mvBaseColor;
		Vector3d mvTextColor;

	public:

		HUDModule();
		~HUDModule();

		// Vector for all the elements.
		// Last put on has highest focus.
		std::vector<HUDElement *> mvElements;
		std::vector<HUDElement *> mvNewElements;

		// What element has focus?
		HUDElement *mpFocusedElement;

		// What element is being hovered over?
		HUDElement *mpHoveredElement;

		// Add an element to the module stack
		void addElement( HUDElement *pElement );

		// Run/Initialize
		int run();
		int initialize();

		// Set default color scheme for all elements
		void setBaseColor( Vector3d vColor );
		void setTextColor( Vector3d vColor );

		// Get color scheme
		Vector3d getBaseColor();
		Vector3d getTextColor();

		// WndProc sends us messages occasionally.  Deal with it.
		void mouseInput( float X, float Y, UINT nDown );
		void keyboardInput( UINT nKey );
	};
}
#endif
